package com.rionosoft.demo.common;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.rionosoft.demo.R;

public class CommonDisplayActivity extends Activity implements OnClickListener {
	
	private TextView mDisplay;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.common_display_with_btn);
		configBody();
	}
	
	private void configBody() {
		mDisplay = (TextView) findViewById(R.id.display_txt);
		Button closeBtn = (Button) findViewById(R.id.close_btn);
		closeBtn.setOnClickListener(this);
	}
	
	public void setDisplayText(String text) {
		mDisplay.setText(text);
	}
	
	public void setDisplayText(int resId) {
		String text = this.getString(resId);
		mDisplay.setText(text);
	}

	@Override
	public void onClick(View v) {
		this.finish();
	}

}
